/*
 * @Descripttion: 
 * @version: 
 * @Author: guangyunl
 * @Date: 2024-03-09 02:34:45
 * @LastEditors: guangyunl
 * @LastEditTime: 2024-03-17 23:57:13
 */
// 活动接口文件

'use strict';
const { Controller } = require('egg');

class cActivitys extends Controller {

    //活动查询
    async pc_c_query_activitys() {
        const { ctx } = this;
        const result = await ctx.service.sActivitys.pc_s_query_activitys(ctx?.query ?? {});
        ctx.body = result;
    }

    //活动增加
    async pc_c_create_activitys() {
        const { ctx } = this;
        const result = await ctx.service.sActivitys.pc_s_create_activitys(ctx?.request?.body ?? {});
        ctx.body = result;
    }

    //活动修改
    async pc_c_update_activitys() {
        const { ctx } = this;
        const result = await ctx.service.sActivitys.pc_s_update_activitys(ctx?.request?.body ?? {});
        ctx.body = result;
    }

    //活动删除
    async pc_c_delete_activitys() {
        const { ctx } = this;
        const result = await ctx.service.sActivitys.pc_s_delete_activitys(ctx?.query ?? {});
        ctx.body = result;
    }

    //根据活动id查询所有商品
    async pc_c_queryActivityProducts() {
        const { ctx } = this;
        const result = await ctx.service.sActivitys.pc_s_queryActivityProducts(ctx?.query ?? {});
        ctx.body = result;
    }

  // 批量挂载商品资源
  async pc_c_batchMount () {
    console.log('?? - pc_c_batchMount');
    const { ctx } = this;
    const result = await ctx.service.sActivitys.pc_s_batchMount(ctx?.request?.body ?? {});
    ctx.body = result;
  }

    // 批量移除商品资源
    async pc_c_batchRemove () {
        console.log('?? - pc_c_batchRemove');
        const { ctx } = this;
        const result = await ctx.service.sActivitys.pc_s_batchRemove(ctx?.request?.body ?? {});
        ctx.body = result;
      }
    


    // 【小程序端】获取活动类型&商品
    async wa_c_queryActivitys() {
        const { ctx } = this;
        const result = await ctx.service.sActivitys.wa_s_queryActivitys(ctx?.query ?? {});
        ctx.body = result;
    }

}

module.exports = cActivitys;